package club.janna.concurrency.example.singleton;

import club.janna.concurrency.annotation.ThreadSafe;

/**
 * 单例模式-恶汉模式
 * 类装载时进行初始化，如果没有使用到，则会导致资源浪费
 * @Auther: guopanbo
 * @Date: 2018/8/1 21:49
 * @Description:
 */
@ThreadSafe
public class SingletonExample1 {

    private SingletonExample1() {}

    private static SingletonExample1 instance = new SingletonExample1();


    public static SingletonExample1 getInstance() {
        return instance;
    }
}
